import { BaseShape } from './BaseShape';
import { IType } from './IShape';
import { IColor } from './IStage';

export class Barcode extends BaseShape {
  /* 背景颜色 */
  bgcolor: IColor;

  /* 是否显示文字 */
  showText: any;

  /* 文本 */
  text: string;

  /* 线条颜色 */
  textColor: IColor;

  /* 边距 */
  margin: number;

  rotate: number;

  /* 预览图，上传时需要清除 */
  src: string;

  constructor() {
    super(IType.BARCODE);
    this.bgcolor = IColor.WHITE;
    this.showText = false;
    this.text = '1010';
    this.textColor = IColor.BLACK;
    this.margin = 0;
    this.src = '';
    this.w = 80;
    this.h = 20;
    this.rotate = 0;
    // this.lockAspectRatio = true;
    this.icon = 'upc-scan';
    this.handles = ['tr', 'tl', 'bl', 'br'];
  }
}
/* 动态条形码 */
export class DBarcode extends Barcode {
  constructor() {
    super();
    this.type = IType.DBARCODE;
    this.handles = ['tr', 'tl', 'bl', 'br'];
  }
}
